﻿//7.	内装介质与检验结论统计
var xData_105 = ["液化石油气","天然气","液氨","液氧","液态二氧化碳","丙烷","环氧乙烷","丁二烯","液氮","液氯","丙烯","液氩","氯乙烯","液氩、液氧、液氮",];
var legendData_105 = ['1 级', '2 级','合格', '允许使用', '整改后使用','']
//1级
var _data_105_1 =[21, 0, 13, 4, 3, 1, 2, 3, 0, 2, 1, 1, 0, 1];
//2级
var _data_105_2 =[27, 3, 23, 11, 4, 2, 1, 5, 4, 4, 0, 0, 1, 0];
var  _data_105_3 = [76, 66, 24, 2, 3, 2, 4, 3, 2, 1, 0, 2, 0, 0];
var  _data_105_4 =[61, 73, 33, 14, 0, 2, 3, 0, 2, 1, 1, 0, 0, 0];
var  _data_105_5 =  [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
option105 = {
    title: {
        // "text": "生产总值累计值\n",
        subtext:"",
        // top:'12%',
        top:'2%',
        // "left": "1%",
        "subtextStyle": {
            "color": "#fff",
            fontWeight:800,
            fontSize:16
        },
        textStyle:{
            "color": "#fff",
            fontSize:28
        }
    },

    // backgroundColor: '#020306',
    color: ['#4162ff', '#c78b42', '#CD3F2A', '#ff6e72', '#9692ff'],
    tooltip: {
        trigger: 'axis',
        axisPointer: {
            type: 'shadow'
        },
        formatter: function(params) {
            // console.log(params)
            var indexX =0;
            for(var x=0;x<xData_105.length;x++){
                if(params[0].name === xData_105[x]){
                    indexX = x;
                    break;
                }
            }
            var sum = _data_105_1[indexX] + _data_105_2[indexX] + _data_105_3[indexX] + _data_105_4[indexX] + _data_105_5[indexX];

            var displayString = '内装介质：' + params[0].name
            for(var m =0;m<params.length;m++){
                var itemString = '<br/>'+ params[m].marker + params[m].seriesName +':数量：' + params[m].data+ '，' + '占比：' + (params[m].data / sum * 100).toFixed(2) + '%，总数:'+sum;
                displayString = displayString + itemString
            }
            return displayString
        }
    },
    legend: {
        // top:'10%',
        // right:'5%',
        textStyle:{
            color:'#FFFFFF',
            fontSize: 16
        },
        // orient: 'vertical',
        data: legendData_105
    },
    grid: {
        // left: '10%',
        // right: '10%',
        // bottom: '20%',
        bottom: '100',
        // top: '27%',
        // containLabel: true,
        // z: 22
    },
    yAxis: [{
        type: 'value',
        splitLine: {
            show: true,
            lineStyle: {
                color: ['#f2f2f2']
            }
        },
        axisLine: {
            lineStyle: {
                color: '#0c3b71'
            }
        },
        axisLabel: {
            // color: 'rgb(170,170,170)',
            formatter: '{value} ',
            textStyle: {
                color: '#fff',
                fontSize: '16'
            },
        }
    }],
    xAxis: [{
        type: 'category',
        axisLine: {
            lineStyle: {
                color: '#0c3b71'
            }
        },
        axisLabel: {
            show: true,
            // color: 'rgb(170,170,170)',
            // fontSize:14
            textStyle: {
                color: '#fff',
                fontSize: '16'
            },
            rotate:40 ,
        },
        data:xData_105
    }],
    series: [{
        name: '合格',
        type: 'bar',
        stack: '总量',
        barWidth: '16px',
        data: _data_105_3
        // markArea: areaStyle
    },
        {
            name: '允许使用',
            type: 'bar',
            stack: '总量',
            data: _data_105_4
            // markArea: areaStyle
        },
        {
            name: '2 级',
            type: 'bar',
            stack: '总量',
            data: _data_105_2
            // markArea: areaStyle
        },
        {
            name: '1 级',
            type: 'bar',
            stack: '总量',
            data: _data_105_1
            // markArea: areaStyle
        },
        {
            name: '整改后使用',
            type: 'bar',
            stack: '总量',
            data:_data_105_5
            // markArea: areaStyle
        },
        // {
        //     name: '',
        //     type: 'bar',
        //     xAxisIndex: 0,
        //     barWidth: '16px',
        //     barGap: '-95%',
        //     itemStyle: {
        //         normal: {
        //             color: 'rgba(255,255,255,0.1)'
        //         }
        //     },
        //     zlevel: 9,
        //     data: [700, 700, 700, 700, 700, 700, 700, 700, 700, 700, 700, 700, 700, 700,],
        //     // markArea: areaStyle
        // },
    ]
};
